<template>
  <div id="app">
  
    <MyPanel v-for="item in list" :key=item.id
        :price=item.price
        :title=item.title
         
        :idaa=item.id
        @sayPrice="kanjian"
        ></MyPanel>
        
      
  </div>
</template>

<script>
import MyPanel from './components/MyPanel'


export default {
  components:{
    MyPanel
   
  },
  methods: {
   kanjian(num,id) {
    console.log(id);
    const item=  this.list.find(item=>item.id===id)
      item.title= item.title-num
    },
  },
  data() {
    return {
      list:[{
        id:1,
        price:"无敌鸡腿",
        title:9,
        
      },{
        id:2,
        price:"无敌香肠",
        title:8,
        
      },{
        id:3,
        price:"无敌鸭腿",
        title:10,
        
      }],
       msg:'好吃不贵'
    }
  }
}
</script>

<style lang="less">
body {
  background-color: #ccc;
  
}
</style>